feat(spice): per-block batch light-client variant (experiment)#15968
Draft
darioush wants to merge 7 commits into
Draft
feat(spice): per-block batch light-client variant (experiment)#15968darioush wants to merge 7 commits into
darioush wants to merge 7 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #15968 +/- ##
==========================================
+ Coverage 72.49% 72.52% +0.02%
==========================================
Files 946 946
Lines 204277 204704 +427
Branches 204277 204704 +427
==========================================
+ Hits 148094 148461 +367
- Misses 51215 51240 +25
- Partials 4968 5003 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimental per-block "batch" (fan-out) variant of the SPICE light-client execution anchor, built head-to-head against the shipped global-accumulator stack (#15962–#15967) to settle whether global was the right call. Based on PR3 (darioush/spice-lc-roots-reader-3), so this diff is the fan-out divergence only and lines up against global's PR4–6.
Instead of one growing fork-safe accumulator anchored at the head, each block commits a small Merkle root (reusing the existing
certified_block_merkle_rootfield) over only the blocks it newly certifies. A proof anchors on the certifying block C via a flatH -> Clookup (the single newCertifiedByBlockcolumn), then anchors C into the head'sblock_merkle_rootwith today's consensus block proof. Validation is self-contained: recompute the batch root from the block's own statements and compare, with the index re-pointed to follow the canonical chain on reorg.Trade vs global: ~31% less production code across 4 fewer files, one DB column instead of three and no new persisted borsh types, at the cost of a permanent 6-field proof (vs 4) and a verification asymmetry (the merklize batch hop hashes its leaf). The comparison writeup recommends keeping global, since the proof cost is paid forever and is consensus-facing while the production-state complexity is paid once behind an internal interface.
Experiment only; not intended to merge.